Desfire.ExecCommand
Generic command to communicate to a DESFire card. Depending on the value of the CryptoMode parameter, data will be transmitted plain, MACed or encrypted.
The DESFire command frame has to be split into two parts, header and data. The data block will be encrypted whereas the header block is left unencrypted.
Example: in the Desfire ChangeKeySettings command, the header is empty. The encrypted key settings will be transferred in the data block.
Properties
- Command code: 0x1B00
- Command timeout: 1000 ms
- Possible status codes: General status codes, Desfire.ErrIso14NoTag, Desfire.ErrBreak, Desfire.ErrIso14Hf, Desfire.ErrIso14CardInvalid, Desfire.ErrReaderChipCommunication, Desfire.ErrIso14ApduCmd, Desfire.ErrIso14InvalidResponse, Desfire.ErrIntegrity, Desfire.ErrNoChanges, Desfire.ErrPcdParam, Desfire.ErrFirmwareNotSupported, Desfire.ErrSamCommunication, Desfire.ErrSamUnlock, Desfire.ErrHardwareNotSupported, Desfire.ErrLength, Desfire.ErrPermissionDenied, Desfire.ErrParameter, Desfire.ErrAppNotFound, Desfire.ErrAppIntegrity, Desfire.ErrAuthentication, Desfire.ErrBoundary, Desfire.ErrPiccIntegrity, Desfire.ErrCommandAborted, Desfire.ErrPiccDisabled, Desfire.ErrCount, Desfire.ErrDuplicate, Desfire.ErrEeprom, Desfire.ErrFileNotFound, Desfire.ErrFileIntegrity, Desfire.ErrNoSuchKey, Desfire.ErrOutOfMemory, Desfire.ErrIllegalCmd, Desfire.ErrCmdOverflow, Desfire.ErrIllegalCmdLegacy
Parameters (request frame)
Name | Type/Size | Description | |
---|---|---|---|
Cmd | Integer (8 bits) | DESFire Command code | |
Length of Header | Integer (8 bits) |
Length of Header in bytes |
|
Header | Raw data | Header of command. The header is always sent buf unencrypted. It must not be larger than 59 bytes. | |
Length of Param | Integer (16 bits) |
Length of Param in bytes |
|
Param | Raw data | Parameter data of command (will be encrypted or MACed according to the value of the CryptoMode variable). | |
CryptoMode | Enumeration (8 bits) |
Type of encryption. Values:
|
|
ResponseLen | Integer (16 bits) | Expected length of response. For commands where the length of the response is not known by the host (i.e. Desfire.ReadData with Len = 0), this value has to be set to 0xFFFF. |
Returned values (response frame)
Name | Type/Size | Description |
---|---|---|
Length of Resp | Integer (16 bits) |
Length of Resp in bytes |
Resp | Raw data | Response of command. |